package com.xiaokaceng.openci.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.xiaokaceng.openci.domain.Developer;

public class DeveloperDto implements Serializable {

	private static final long serialVersionUID = -2575308409391110941L;

	private Long id;

	private String developerId;

	private String name;

	private String email;
	
	private String password;

	public DeveloperDto(Long id, String developerId, String name, String email, String password) {
		this.id = id;
		this.developerId = developerId;
		this.name = name;
		this.email = email;
		this.password = password;
	}

	public static List<DeveloperDto> transformBy(List<Developer> developers) {
		List<DeveloperDto> developerDtos = new ArrayList<DeveloperDto>();
		if (!developers.isEmpty()) {
			for (Developer each : developers) {
				developerDtos.add(new DeveloperDto(each.getId(), each.getDeveloperId(), each.getName(), each.getEmail(), each.getPassword()));
			}
		}
		return developerDtos;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getDeveloperId() {
		return developerId;
	}

	public void setDeveloperId(String developerId) {
		this.developerId = developerId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
